import request from '@/config/axios'

export interface VideoInfoVO {
  id: number
  accountId: number
  cover: string
  videoId: string
  title: string
  caption: string
  type: string
  shareLinkDesc: string
  playAdress: string
  ossPath: string
  diggCount: number
  shareCount: number
  commentCount: number
  collectCount: number
  duration: number
  publishTime: Date
  remark: string
  jsonSource: string
}

// 查询视频信息列表
export const getVideoInfoPage = async (params) => {
  return await request.get({ url: `/beat/video-info/page`, params })
}

// 查询视频信息详情
export const getVideoInfo = async (id: number) => {
  return await request.get({ url: `/beat/video-info/get?id=` + id })
}

// 新增视频信息
export const createVideoInfo = async (data: VideoInfoVO) => {
  return await request.post({ url: `/beat/video-info/create`, data })
}

// 修改视频信息
export const updateVideoInfo = async (data: VideoInfoVO) => {
  return await request.put({ url: `/beat/video-info/update`, data })
}

// 删除视频信息
export const deleteVideoInfo = async (id: number) => {
  return await request.delete({ url: `/beat/video-info/delete?id=` + id })
}

// 导出视频信息 Excel
export const exportVideoInfo = async (params) => {
  return await request.download({ url: `/beat/video-info/export-excel`, params })
}
